/**
 * @使用嵌套循环
 *
 * @author	 wangshikun <wangshikun2010@gmail.com>
 * @copyright	(c) 2012 wangshikun <wangshikun2010@gmail.com>
 * @license	http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package	default
 * @subpackage	default
 */

#include <stdio.h>
#include <cs50.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
	int number;
	for (int i=1; i<=5; ++i) {
		printf("请输入数字：");
		scanf("%i", &number);

		int s = 0;

		for (int n=1; n<=number; ++n) {
			s += n;
		}

		printf("%i行三角形是%i个*\n", number, s);
	}
}
